// -*- c-basic-offset: 2 default-tab-width: 2 indent-tabs-mode: t -*-
// vim: autoindent tabstop=2 noexpandtab shiftwidth=2 softtabstop=2
#ifndef _CONST_H_
#define _CONST_H_

#include "Array.h"

namespace R {
	class Logical;

	class ConstPool {
		public:
		int size;
		int capacity;
		Any **data;

		Any *mkconst(cpool_entry *pe, cpool_entry *cpool_src, Any**cpool_dest);
		void enlargePool(int cap);

		ConstPool(int cap = 760);
		void loadPool(int size, cpool_entry *);

		Any *operator[](int idx);
		void tracer(word_t closure);

		/* If we add objects here, don't forget to update VirtualTable.cc accordingly */
		static void initConsts();
		static Logical *True; // TODO move them inside logical
		static Logical *False; // TODO maybe do the same with some NA value
		static Any *Null;

		// For File.h
		static const char *HomeDir;
		static const char *Path;
		static const char *ReactorPath;

		static const char *NA_STRING; // TODO maybe do the same with some NA value
		// TODO Add Null like this
		static const int NA_INT;
		static const unsigned NA_LOG;
		static const double NA_DOUBLE;

		static const double InfPos;
		static const double InfNeg;
		static const double NaN;
		static const char *TRUE_STRING, *FALSE_STRING; //FIXME rename all these const, names are ugly
	};
	
	#include "Convert.h"
	#include "NA.h"
}

#endif
